﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using CE.Global;


public partial class Provider_Detail : MyLanguageBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int _pid = 0;

            if (Request.QueryString["pid"] != null)
            {
                if (Request.QueryString["pid"].ToString().Trim() != "")
                    _pid = int.Parse(Request.QueryString["pid"].ToString().Trim());

                GetProviderDetails(_pid);
            }
        }

    }

    private void GetProviderDetails(int providerid)
    {
        string _lang = "2"; //english
        if (Session["Language"] != null)
        {
            if (Session["Language"].ToString() == "th-TH")
                _lang = "1";
        }
       
        lblProvider.Text = CE.Global.General.GetProviderName(providerid, _lang);
        imgProvider.ImageUrl = "http://www.gluaygluay.com/" + CE.Global.General.GetProviderCompanyLogo(providerid.ToString());

        if (providerid == 11)
        {
            lblProviderDescription.Text = Resources.Provider.AZCPdesc;
        }
        else if (providerid == 12)
        {
            lblProviderDescription.Text = Resources.Provider.MSIGdesc;
        }
        else if (providerid == 16)
        {
            lblProviderDescription.Text = Resources.Provider.AXAdesc;
        }
        else if (providerid == 29)
        {
            lblProviderDescription.Text = Resources.Provider.LMGdesc;
        }
        else if (providerid == 31)
        {
            lblProviderDescription.Text = Resources.Provider.Chartisdesc;
        }
        else if (providerid == 32)
        {
            lblProviderDescription.Text = Resources.Provider.BKIdesc;
        }
        else if (providerid == 33)
        {
            lblProviderDescription.Text = Resources.Provider.Muangthaidesc;
        }
        else if (providerid == 35)
        {
            //_result = "KrungThai Insurance";
            lblProviderDescription.Text = Resources.Provider.Kurniadesc; ;
        }
        else if (providerid == 39)
        {
            lblProviderDescription.Text = Resources.Provider.Mittaredesc;
        }
        else if (providerid == 41)
        {
            //_result = "KSK Insurance";
            lblProviderDescription.Text = Resources.Provider.Kurniadesc;
        }
        else if (providerid == 43)
        {
            lblProviderDescription.Text = Resources.Provider.SMKdesc;
        }
        else if (providerid == 45)
        {
            lblProviderDescription.Text = Resources.Provider.Viriyahdesc;
        }
        else if (providerid == 46)
        {
            lblProviderDescription.Text = Resources.Provider.Tokiodesc;
        }
        else if (providerid == 50)
        {
            lblProviderDescription.Text = Resources.Provider.SCBdesc;
        }
        else if (providerid == 58)
        {
            lblProviderDescription.Text = Resources.Provider.Thaivivatdesc;
        }
    }

}
